<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>调查问卷</title>
    <script src="https://cdn.tailwindcss.com"></script>
    
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#3B82F6',
                    },
                }
            }
        }
    </script>
    
    <style type="text/tailwindcss">
        @layer utilities {
            .form-input {
                @apply w-full px-3 py-2 border border-gray-300 rounded focus:border-primary focus:ring focus:ring-primary/20 focus:outline-none transition-all;
            }
            .btn-submit {
                @apply bg-primary text-white px-4 py-2 rounded hover:bg-primary/90 transition-colors;
            }
        }
    </style>
</head>
<body class="bg-gray-50 p-4 md:p-8">
    <div class="max-w-2xl mx-auto bg-white p-6 md:p-8 rounded-lg shadow">
        <h1 class="text-2xl font-bold text-center mb-6">调查问卷</h1>
        
        <form id="surveyForm" action="/survey.do" method="post" class="space-y-5">
            <div>
                <label for="name" class="block text-gray-700 mb-1">姓名</label>
                <input type="text" id="name" name="name" class="form-input" required placeholder="请输入您的姓名">
            </div>
  
            <div>
                <label for="age" class="block text-gray-700 mb-1">年龄</label>
                <input type="number" id="age" name="age" min="0" max="120" class="form-input" required placeholder="请输入您的年龄">
            </div>
     
            <div>
                <label class="block text-gray-700 mb-2">性别</label>
                <div class="flex gap-4">
                    <label class="inline-flex items-center">
                        <input type="radio" name="gender" value="男" required class="text-primary">
                        <span class="ml-1">男</span>
                    </label>
                    <label class="inline-flex items-center">
                        <input type="radio" name="gender" value="女" required class="text-primary">
                        <span class="ml-1">女</span>
                    </label>
                    <label class="inline-flex items-center">
                        <input type="radio" name="gender" value="其他" required class="text-primary">
                        <span class="ml-1">其他</span>
                    </label>
                </div>
            </div>
     
            <div>
                <label for="phone" class="block text-gray-700 mb-1">联系电话</label>
                <input type="tel" id="phone" name="phone" class="form-input" required placeholder="请输入您的联系电话">
            </div>
            
            <div>
                <label class="block text-gray-700 mb-2">地址信息</label>
                
                <div class="grid grid-cols-1 md:grid-cols-3 gap-3 mb-3">
              
                    <div>
                        <select id="province" name="province" class="form-input" required>
                            <option value="" disabled selected>省份</option>
                            <option value="北京">北京</option>
                            <option value="上海">上海</option>
                            <option value="广东">广东</option>
                            <option value="江苏">江苏</option>
                            <option value="浙江">浙江</option>
                            <option value="其他">其他</option>
                        </select>
                    </div>
                    
            
                    <div>
                        <select id="city" name="city" class="form-input" required>
                            <option value="" disabled selected>城市</option>
                            <option value="北京">北京</option>
                            <option value="上海">上海</option>
                            <option value="广州">广州</option>
                            <option value="深圳">深圳</option>
                            <option value="杭州">杭州</option>
                            <option value="南京">南京</option>
                            <option value="其他">其他</option>
                        </select>
                    </div>
                    
                    <!-- 区/县 -->
                    <div>
                        <input type="text" id="district" name="district" class="form-input" required placeholder="区/县">
                    </div>
                </div>
                
                <!-- 详细地址：添加name属性 -->
                <div>
                    <input type="text" id="detailAddress" name="detailAddress" class="form-input" required placeholder="详细地址（街道、门牌号等）">
                </div>
            </div>
            
            <!-- 提交按钮 -->
            <div class="pt-2">
                <button type="submit" class="btn-submit w-full">提交</button>
            </div>
        </form>
    </div>

    <script>
        document.getElementById('surveyForm').addEventListener('submit', function(e) {
            e.preventDefault();
            
            // 提交表单到后端
            this.submit();
        });
    </script>
</body>
</html>
    
    